package com.ruoyi.base.service.impl;

import java.util.List;
import java.util.UUID;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.base.mapper.BasAgricultureMapper;
import com.ruoyi.base.domain.BasAgriculture;
import com.ruoyi.base.service.IBasAgricultureService;

/**
 * 农业污染源Service业务层处理
 * 
 * @author maliang
 * @date 2025-08-18
 */
@Service
public class BasAgricultureServiceImpl implements IBasAgricultureService 
{
    @Autowired
    private BasAgricultureMapper basAgricultureMapper;

    /**
     * 查询农业污染源
     * 
     * @param id 农业污染源主键
     * @return 农业污染源
     */
    @Override
    public BasAgriculture selectBasAgricultureById(String id)
    {
        return basAgricultureMapper.selectBasAgricultureById(id);
    }

    /**
     * 查询农业污染源列表
     * 
     * @param basAgriculture 农业污染源
     * @return 农业污染源
     */
    @Override
    public List<BasAgriculture> selectBasAgricultureList(BasAgriculture basAgriculture)
    {
        return basAgricultureMapper.selectBasAgricultureList(basAgriculture);
    }

    /**
     * 新增农业污染源
     * 
     * @param basAgriculture 农业污染源
     * @return 结果
     */
    @Override
    public int insertBasAgriculture(BasAgriculture basAgriculture)
    {
        basAgriculture.setId(UUID.randomUUID().toString());
        return basAgricultureMapper.insertBasAgriculture(basAgriculture);
    }

    /**
     * 修改农业污染源
     * 
     * @param basAgriculture 农业污染源
     * @return 结果
     */
    @Override
    public int updateBasAgriculture(BasAgriculture basAgriculture)
    {
        return basAgricultureMapper.updateBasAgriculture(basAgriculture);
    }

    /**
     * 批量删除农业污染源
     * 
     * @param ids 需要删除的农业污染源主键
     * @return 结果
     */
    @Override
    public int deleteBasAgricultureByIds(String[] ids)
    {
        return basAgricultureMapper.deleteBasAgricultureByIds(ids);
    }

    /**
     * 删除农业污染源信息
     * 
     * @param id 农业污染源主键
     * @return 结果
     */
    @Override
    public int deleteBasAgricultureById(String id)
    {
        return basAgricultureMapper.deleteBasAgricultureById(id);
    }
}
